import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      component: resolve => require(['@/App'], resolve),
      redirect: '/main',
    }, {
      path: '/main',
      name: '首页',
      footer: true,
      component: resolve => require(['@views/home'], resolve)
    }, {
      path: '/cart',
      name: '购物车',
      footer: true,
      component: resolve => require(['@views/cart'], resolve)
    }, {
      path: '/my',
      name: '我的',
      footer: true,
      component: resolve => require(['@views/my'], resolve)
    }, {
      path: '/class',
      name: '二级分类',
      footer: true,
      component: resolve => require(['@views/home/class.vue'], resolve)
    }, {
      path: '/threeClass',
      name: '三级分类',
      footer: true,
      component: resolve => require(['@views/home/threeClass.vue'], resolve)
    }, {
      path: '/shopping/details',
      name: '商品详情',
      header: true,
      component: resolve => require(['@views/shopping/details.vue'], resolve)
    }, {
      path: '/list',
      type: {
        search: '搜索结果',
        collage: '国际拼团',
        rushToBuy: '限时抢购',
        newProducts: '新品上架'
      },
      header: true,
      component: resolve => require(['@views/list'], resolve)
    }, {
      path: '/classList',
      component: resolve => require(['@views/list/classList.vue'], resolve)
    }, {
      path: '/integralList',
      name: '积分商品',
      header: true,
      component: resolve => require(['@views/list/integralList.vue'], resolve)
    }, {
      path: '/order',
      name: '我的订单',
      header: true,
      component: resolve => require(['@views/my/order.vue'], resolve)
    }, {
      path: '/collect',
      name: '我的收藏',
      header: true,
      component: resolve => require(['@views/my/collect.vue'], resolve)
    }, {
      path: '/discount', 
      name: '我的优惠',
      header: true,
      component: resolve => require(['@views/my/discount.vue'], resolve)
    }, {
      path: '/philanthropy', 
      name: '公益信息',
      header: true,
      component: resolve => require(['@views/my/philanthropy.vue'], resolve)
    }, {
      path: '/philanthropy-details', 
      name: '公益信息详情',
      header: true,
      component: resolve => require(['@views/my/philanthropy-details.vue'], resolve)
    }, {
      path: '/address', 
      name: '确认收货地址',
      header: true,
      component: resolve => require(['@views/my/address.vue'], resolve)
    }, {
      path: '/add-address',
      type: {
        edit: '编辑收货地址',
        add: '新增收货地址'
      },
      header: true,
      component: resolve => require(['@views/my/add-address.vue'], resolve)
    }, {
      path: '/setUp', 
      name: '设置',
      header: true,
      component: resolve => require(['@views/my/setUp.vue'], resolve)
    }, {
      path: '/forgetPwd', 
      name: '修改密码',
      header: true,
      component: resolve => require(['@views/my/forgetPwd.vue'], resolve)
    }, {
      path: '/retunSuccess', 
      name: '申请退款/退货',
      header: true,
      component: resolve => require(['@views/order/retunSuccess.vue'], resolve)
    }, {
      path: '/paySuccess', 
      name: '支付成功',
      header: true,
      component: resolve => require(['@views/order/paySuccess.vue'], resolve)
    }, {
      path: '/applyReturn', 
      name: '申请退款/换货',
      header: true,
      component: resolve => require(['@views/order/applyReturn.vue'], resolve)
    }, {
      path: '/payOrder', 
      name: '支付订单',
      header: true,
      component: resolve => require(['@views/order/payOrder.vue'], resolve)
    }, {
      path: '/login',
      name: '登陆',
      header: true,
      component: resolve => require(['@views/login'], resolve)
    }, {
      path: '/register',
      name: '注册',
      header: true,
      component: resolve => require(['@views/register'], resolve)
    }, {
      path: '/forgetPwdPhone',
      name: '找回密码',
      header: true,
      component: resolve => require(['@views/login/forgetPwd.vue'], resolve)
    }, {
      path: '/about',
      name: '关于我们',
      header: true,
      component: resolve => require(['@views/my/about'], resolve)
    }, {
      path: '/order-details',
      name: '订单详情',
      header: true,
      component: resolve => require(['@views/order/details'], resolve)
    }, {
      path: '/evaluate',
      name: '订单评价',
      header: true,
      component: resolve => require(['@views/order/evaluate'], resolve)
    }
  ]
})